<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/7/27 0027
 * Time: 上午 9:18
 */

namespace app\admin\model;


use think\Model;

class ManagerPickApply extends Model
{
    public function manager(){
        return $this->belongsTo('Manager','mid','id');
    }

    public static function checkMidByid($id,$mid){
        $db = self::get($id)->toArray();
        if ($db['mid']!=$mid){
            return true;
        }else{
            return false;
        }
    }

    public static function getAll(){
        $db = self::with('Manager')->select();
        return $db->visible(['manager'=>['shopname','name','phone','address'],'id','order_num','create_at','status']);
    }
}